<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FEUP-Defender: RealTimeController</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Gerado por Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="../../main.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="../../modules.html"><span>Módulos</span></a></li>
      <li><a href="../../annotated.html"><span>Estruturas&nbsp;de&nbsp;dados</span></a></li>
      <li><a href="../../files.html"><span>Ficheiros</span></a></li>
      <li><a href="../../dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>RealTimeController</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Estruturas de Dados</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d3b/struct_r_t_c___d_a_t_e.html">RTC_DATE</a></td></tr>
<tr><td colspan="2"><h2>Funções</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga4b857d1c0d66ceaf587d2343881252c1">dec2bcd</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e1c48bd3deb14214922fa7b179a4f97"></a><!-- doxytag: member="RealTimeController::rtc_int_enable" ref="ga7e1c48bd3deb14214922fa7b179a4f97" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>rtc_int_enable</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5d4cf2f0b16521c81d780708f511f6b2"></a><!-- doxytag: member="RealTimeController::rtc_int_enable_periodic" ref="ga5d4cf2f0b16521c81d780708f511f6b2" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>rtc_int_enable_periodic</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf9fab10f77d4ba102dce19c433779e91"></a><!-- doxytag: member="RealTimeController::rtc_int_disable" ref="gaf9fab10f77d4ba102dce19c433779e91" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>rtc_int_disable</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gae9b349676544e84360bb9278ef4c0a96">rtc_valid</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga4a59b403e6b8da03106ab2a09ec2431f">read_rtc</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> add)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> add)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga18c4e040accb4c214682d5605f596e60">write_rtc</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> add, <a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga28ed5315f068afb9339b74dd434c04bd">write_rtcv</a> (<a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> add, <a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga3554832f0cd4b7366219d8c1aa9ae321">rtc_read_time</a> (<a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gaef01346a833632b8540100f23fecdd09">rtc_read_date</a> (<a class="el" href="../../df/d3b/struct_r_t_c___d_a_t_e.html">RTC_DATE</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga41fd5f9c71342629f1149063251e3827">rtc_read_alarm</a> (<a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gab5992248e26867cf6bb3b08aa822b37e">rtc_write_alarm</a> (<a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *)</td></tr>
<tr><td colspan="2"><h2>The RTC registers</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrp0e9d1303ea5fcec8cdcf992099c25cc6"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><b>rtc_regs</b> { <br/>
&nbsp;&nbsp;<b>SEC</b>, 
<b>SEC_ALARM</b>, 
<b>MIN</b>, 
<b>MIN_ALARM</b>, 
<br/>
&nbsp;&nbsp;<b>HOUR</b>, 
<b>HOUR_ALARM</b>, 
<b>WEEK_DAY</b>, 
<b>MONTH_DAY</b>, 
<br/>
&nbsp;&nbsp;<b>MONTH</b>, 
<b>YEAR</b>, 
<b>RTC_STAT_A</b>, 
<b>RTC_STAT_B</b>, 
<br/>
&nbsp;&nbsp;<b>RTC_STAT_C</b>, 
<b>RTC_STAT_D</b>
<br/>
 }</td></tr>
<tr><td colspan="2"><h2>PC I/O register address used to comunicate with the RTC</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrpfcd50b13e62b4fe3cb47e15804c52433"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga710b98232df2c563009e6f8a6cd18220"></a><!-- doxytag: member="RealTimeController::RTC_ADDR_REG" ref="ga710b98232df2c563009e6f8a6cd18220" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga710b98232df2c563009e6f8a6cd18220">RTC_ADDR_REG</a>&nbsp;&nbsp;&nbsp;0x70</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">I/O address that contains the RTC address to communicate with. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2f258a00c59c3f347c8d2d4a75471ce0"></a><!-- doxytag: member="RealTimeController::RTC_DATA_REG" ref="ga2f258a00c59c3f347c8d2d4a75471ce0" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga2f258a00c59c3f347c8d2d4a75471ce0">RTC_DATA_REG</a>&nbsp;&nbsp;&nbsp;0x71</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">I/O address that contains the data read from or written to the RTC. <br/></td></tr>
<tr><td colspan="2"><h2>Bit Meaning in STAT-A register</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrpe3be79aa45f0a16507fe65c761442f27"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2ebe3d816d8b2e9f1be075554e4135b3"></a><!-- doxytag: member="RealTimeController::RTC_UIP" ref="ga2ebe3d816d8b2e9f1be075554e4135b3" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga2ebe3d816d8b2e9f1be075554e4135b3">RTC_UIP</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 7)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-update in progress, 0-data valid for next 244 usec <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3e0bb1b127052d36bc4e5ef91e92fb89"></a><!-- doxytag: member="RealTimeController::RTC_DV2" ref="ga3e0bb1b127052d36bc4e5ef91e92fb89" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga3e0bb1b127052d36bc4e5ef91e92fb89">RTC_DV2</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 6)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Divider. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab24bb577503d1089e9257cb1172bdf23"></a><!-- doxytag: member="RealTimeController::RTC_DV1" ref="gab24bb577503d1089e9257cb1172bdf23" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gab24bb577503d1089e9257cb1172bdf23">RTC_DV1</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 5)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Divider. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5911071bc2a9af2eedbabd20b1daf528"></a><!-- doxytag: member="RealTimeController::RTC_DV0" ref="ga5911071bc2a9af2eedbabd20b1daf528" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga5911071bc2a9af2eedbabd20b1daf528">RTC_DV0</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 4)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Divider. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga151a2d40d9019b24ebc14861bbd67551"></a><!-- doxytag: member="RealTimeController::RTC_RS3" ref="ga151a2d40d9019b24ebc14861bbd67551" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga151a2d40d9019b24ebc14861bbd67551">RTC_RS3</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rate selector. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga54d2328341e35419ce7111c8cf3b9d57"></a><!-- doxytag: member="RealTimeController::RTC_RS2" ref="ga54d2328341e35419ce7111c8cf3b9d57" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga54d2328341e35419ce7111c8cf3b9d57">RTC_RS2</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 2)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rate selector. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf2b4f805675fd966c3c4173780b7b15b"></a><!-- doxytag: member="RealTimeController::RTC_RS1" ref="gaf2b4f805675fd966c3c4173780b7b15b" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gaf2b4f805675fd966c3c4173780b7b15b">RTC_RS1</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rate selector. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga722a880e324ceace4b3bd27d2a540404"></a><!-- doxytag: member="RealTimeController::RTC_RS0" ref="ga722a880e324ceace4b3bd27d2a540404" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga722a880e324ceace4b3bd27d2a540404">RTC_RS0</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rate selector. <br/></td></tr>
<tr><td colspan="2"><h2>Bit Meaning in STAT-B register</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrpbcafe01008835cf8c5d1f114c898d03d"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaac2db7539ba4f42b7a399faedc23df39"></a><!-- doxytag: member="RealTimeController::RTC_SET" ref="gaac2db7539ba4f42b7a399faedc23df39" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gaac2db7539ba4f42b7a399faedc23df39">RTC_SET</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 7)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Stop updating, 0-update normally <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8aa3ee782d809767b9e03c49c7756083"></a><!-- doxytag: member="RealTimeController::RTC_PIE" ref="ga8aa3ee782d809767b9e03c49c7756083" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga8aa3ee782d809767b9e03c49c7756083">RTC_PIE</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 6)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Periodic interrupt enable <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6a293d49e03a7f92a09cbb02fb49a08e"></a><!-- doxytag: member="RealTimeController::RTC_AIE" ref="ga6a293d49e03a7f92a09cbb02fb49a08e" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga6a293d49e03a7f92a09cbb02fb49a08e">RTC_AIE</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 5)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Alarm interrupt enable <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3fa059415b73592c094cd9a3f79e6795"></a><!-- doxytag: member="RealTimeController::RTC_UIE" ref="ga3fa059415b73592c094cd9a3f79e6795" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga3fa059415b73592c094cd9a3f79e6795">RTC_UIE</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 4)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Update-ended interrupt enable <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1f8f94a2096173944bc82fec3e9bbd8a"></a><!-- doxytag: member="RealTimeController::RTC_SQWE" ref="ga1f8f94a2096173944bc82fec3e9bbd8a" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga1f8f94a2096173944bc82fec3e9bbd8a">RTC_SQWE</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Square Wave Enable <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafe5d31647d8882e7fa9ea7030baa2780"></a><!-- doxytag: member="RealTimeController::RTC_DM" ref="gafe5d31647d8882e7fa9ea7030baa2780" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#gafe5d31647d8882e7fa9ea7030baa2780">RTC_DM</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 2)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data Mode, 1-Binary, 0-BCD. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4d3c383e9185072b666e8ed980d20471"></a><!-- doxytag: member="RealTimeController::RTC_12_24" ref="ga4d3c383e9185072b666e8ed980d20471" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga4d3c383e9185072b666e8ed980d20471">RTC_12_24</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-24 hours, 0-12 hours <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga18836ba9bcbd0bee568bdd21b163cae1"></a><!-- doxytag: member="RealTimeController::RTC_DSE" ref="ga18836ba9bcbd0bee568bdd21b163cae1" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga18836ba9bcbd0bee568bdd21b163cae1">RTC_DSE</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Day-light saving <br/></td></tr>
<tr><td colspan="2"><h2>Bit Meaning in STAT-C register</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrp3617b812d32487a86e476f6014306496"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga01c8262113ddc3b618fb7c97395ed142"></a><!-- doxytag: member="RealTimeController::RTC_IRQF" ref="ga01c8262113ddc3b618fb7c97395ed142" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga01c8262113ddc3b618fb7c97395ed142">RTC_IRQF</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 7)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-An interrupt occurred, if PF=PIE=1 || AF=AIE=1 || UF=UIE=1 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9d9fa73fa39aa2500273df240594afe6"></a><!-- doxytag: member="RealTimeController::RTC_PF" ref="ga9d9fa73fa39aa2500273df240594afe6" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga9d9fa73fa39aa2500273df240594afe6">RTC_PF</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 6)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Periodic interrupt occurred <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0ed62fab6c50790f2c4b71849f2000b2"></a><!-- doxytag: member="RealTimeController::RTC_AF" ref="ga0ed62fab6c50790f2c4b71849f2000b2" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga0ed62fab6c50790f2c4b71849f2000b2">RTC_AF</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 5)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Alarm interrupt occurred <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7c63615d9172c9065f5b9d1875ef6d04"></a><!-- doxytag: member="RealTimeController::RTC_UF" ref="ga7c63615d9172c9065f5b9d1875ef6d04" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga7c63615d9172c9065f5b9d1875ef6d04">RTC_UF</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 4)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Update interrupt occurred <br/></td></tr>
<tr><td colspan="2"><h2>Bit Meaning in STAT-D register</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrp0b91534a839052d2c1ad954e5c07a35d"></a> </p>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga35577ed27885901641e6120257455adb"></a><!-- doxytag: member="RealTimeController::RTC_VRT" ref="ga35577ed27885901641e6120257455adb" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/dd5/group___real_time_controller.html#ga35577ed27885901641e6120257455adb">RTC_VRT</a>&nbsp;&nbsp;&nbsp;(1 &lt;&lt; 7)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">1-Valid RAM and time <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Descrição detalhada</h2>
<p>Real Time Controller related functions </p>
<hr/><h2>Documentação das funções</h2>
<a class="anchor" id="ga839845a3a9f35e3860e525cfe86f3405"></a><!-- doxytag: member="rtc.h::bcd2dec" ref="ga839845a3a9f35e3860e525cfe86f3405" args="(Byte i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> bcd2dec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>i</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>converts BCD (Binary Coded Decimal) to decimal </p>

<p>Definido na linha <a class="el" href="../../#L6">6</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00007"></a>00007 {
<a name="l00008"></a>00008         <span class="keywordflow">return</span> (i &amp; 0x0F) + 10 * ((i &gt;&gt; 4) &amp; 0x0F);
<a name="l00009"></a>00009 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga4b857d1c0d66ceaf587d2343881252c1"></a><!-- doxytag: member="rtc.h::dec2bcd" ref="ga4b857d1c0d66ceaf587d2343881252c1" args="(Byte i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> dec2bcd </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>i</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>converts decimal to BCD (Binary Coded Decimal) </p>

<p>Definido na linha <a class="el" href="../../#L14">14</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00015"></a>00015 {
<a name="l00016"></a>00016         <span class="keywordflow">return</span> (i % 10) + (((i / 10) % 10) &lt;&lt; 4);
<a name="l00017"></a>00017 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga4a59b403e6b8da03106ab2a09ec2431f"></a><!-- doxytag: member="rtc.h::read_rtc" ref="ga4a59b403e6b8da03106ab2a09ec2431f" args="(Byte add)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> read_rtc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>add</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns rtc data from I/O address add. Doesn't check valid bit </p>

<p>Definido na linha <a class="el" href="../../#L65">65</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00066"></a>00066 {
<a name="l00067"></a>00067         <span class="keywordtype">int</span> old_pic1 = get_pic1(), old_pic2 = get_pic2();
<a name="l00068"></a>00068         set_pic_var(0xFF, 0xFF);
<a name="l00069"></a>00069 
<a name="l00070"></a>00070         outportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga710b98232df2c563009e6f8a6cd18220" title="I/O address that contains the RTC address to communicate with.">RTC_ADDR_REG</a>, add);
<a name="l00071"></a>00071         <a class="code" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f" title="8 bits, only on i386">Byte</a> val = inportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga2f258a00c59c3f347c8d2d4a75471ce0" title="I/O address that contains the data read from or written to the RTC.">RTC_DATA_REG</a>);
<a name="l00072"></a>00072 
<a name="l00073"></a>00073         set_pic_var(old_pic1, old_pic2);
<a name="l00074"></a>00074         <span class="keywordflow">return</span> val;
<a name="l00075"></a>00075 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga433f5ef3940f2cce7b17aa9771080516"></a><!-- doxytag: member="rtc.h::read_rtcv" ref="ga433f5ef3940f2cce7b17aa9771080516" args="(Byte add)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a> read_rtcv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>add</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns rtc data from I/O address add. Check valid bit </p>

<p>Definido na linha <a class="el" href="../../#L80">80</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00081"></a>00081 {
<a name="l00082"></a>00082         <a class="code" href="../../da/dd5/group___real_time_controller.html#gae9b349676544e84360bb9278ef4c0a96">rtc_valid</a>();
<a name="l00083"></a>00083         <span class="keywordflow">return</span> <a class="code" href="../../da/dd5/group___real_time_controller.html#ga4a59b403e6b8da03106ab2a09ec2431f">read_rtc</a>(add);
<a name="l00084"></a>00084 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga41fd5f9c71342629f1149063251e3827"></a><!-- doxytag: member="rtc.h::rtc_read_alarm" ref="ga41fd5f9c71342629f1149063251e3827" args="(RTC_TIME *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rtc_read_alarm </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *&nbsp;</td>
          <td class="paramname"> <em>rt</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read RTC stored alarm</p>
<p>Uses <a class="el" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv()</a> and <a class="el" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec()</a> </p>

<p>Definido na linha <a class="el" href="../../#L138">138</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00139"></a>00139 {
<a name="l00140"></a>00140         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#aeb283a5d8814993038c435081e7f0934" title="The hour of the day.">hour</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(HOUR_ALARM));
<a name="l00141"></a>00141         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a4b44a71ebc76adae29903e31e654ebc1" title="The minute of the day.">min</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(MIN_ALARM));
<a name="l00142"></a>00142         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a9f4184ece6c72bbef577e4f4f84a18dc" title="The second of the day.">sec</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(SEC_ALARM));
<a name="l00143"></a>00143 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="gaef01346a833632b8540100f23fecdd09"></a><!-- doxytag: member="rtc.h::rtc_read_date" ref="gaef01346a833632b8540100f23fecdd09" args="(RTC_DATE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rtc_read_date </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../df/d3b/struct_r_t_c___d_a_t_e.html">RTC_DATE</a> *&nbsp;</td>
          <td class="paramname"> <em>rd</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read RTC stored date</p>
<p>Uses <a class="el" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv()</a> and <a class="el" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec()</a> </p>

<p>Definido na linha <a class="el" href="../../#L126">126</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00127"></a>00127 {
<a name="l00128"></a>00128         rd-&gt;<a class="code" href="../../df/d3b/struct_r_t_c___d_a_t_e.html#ae0a04a3d3762ce166c4da4795fc73d64" title="The year.">year</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(YEAR));
<a name="l00129"></a>00129         rd-&gt;<a class="code" href="../../df/d3b/struct_r_t_c___d_a_t_e.html#ab1e7b0e6aa1c8025d8731534084bd257" title="The day of the year.">month</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(MONTH));
<a name="l00130"></a>00130         rd-&gt;<a class="code" href="../../df/d3b/struct_r_t_c___d_a_t_e.html#ab2218343ca3baa32ee5f7200a23ce983" title="The day of the month.">day</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(MONTH_DAY));
<a name="l00131"></a>00131 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga3554832f0cd4b7366219d8c1aa9ae321"></a><!-- doxytag: member="rtc.h::rtc_read_time" ref="ga3554832f0cd4b7366219d8c1aa9ae321" args="(RTC_TIME *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rtc_read_time </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *&nbsp;</td>
          <td class="paramname"> <em>rt</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read RTC stored time</p>
<p>Uses <a class="el" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv()</a> and <a class="el" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec()</a> </p>

<p>Definido na linha <a class="el" href="../../#L114">114</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00115"></a>00115 {
<a name="l00116"></a>00116         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#aeb283a5d8814993038c435081e7f0934" title="The hour of the day.">hour</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(HOUR));
<a name="l00117"></a>00117         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a4b44a71ebc76adae29903e31e654ebc1" title="The minute of the day.">min</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(MIN));
<a name="l00118"></a>00118         rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a9f4184ece6c72bbef577e4f4f84a18dc" title="The second of the day.">sec</a> = <a class="code" href="../../da/dd5/group___real_time_controller.html#ga839845a3a9f35e3860e525cfe86f3405">bcd2dec</a>(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga433f5ef3940f2cce7b17aa9771080516">read_rtcv</a>(SEC));
<a name="l00119"></a>00119 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="gae9b349676544e84360bb9278ef4c0a96"></a><!-- doxytag: member="rtc.h::rtc_valid" ref="gae9b349676544e84360bb9278ef4c0a96" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rtc_valid </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Wait until data in rtc is valid. Data is valid until +/- 240 usec after this function returns, thus a read/write can be done to the RTC within this time period </p>

<p>Definido na linha <a class="el" href="../../#L48">48</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00049"></a>00049 {
<a name="l00050"></a>00050         <span class="keywordtype">int</span> old_pic1 = get_pic1(), old_pic2 = get_pic2();
<a name="l00051"></a>00051         set_pic_var(0xFF, 0xFF);
<a name="l00052"></a>00052 
<a name="l00053"></a>00053         outportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga710b98232df2c563009e6f8a6cd18220" title="I/O address that contains the RTC address to communicate with.">RTC_ADDR_REG</a>, RTC_STAT_A); <span class="comment">// read STAT_A</span>
<a name="l00054"></a>00054         
<a name="l00055"></a>00055         <span class="comment">// wait if Update In Progress (UIP)</span>
<a name="l00056"></a>00056         <span class="keywordflow">while</span> (inportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga2f258a00c59c3f347c8d2d4a75471ce0" title="I/O address that contains the data read from or written to the RTC.">RTC_DATA_REG</a>) &amp; <a class="code" href="../../da/dd5/group___real_time_controller.html#ga2ebe3d816d8b2e9f1be075554e4135b3" title="1-update in progress, 0-data valid for next 244 usec">RTC_UIP</a>)
<a name="l00057"></a>00057         ; <span class="comment">// data is invalid</span>
<a name="l00058"></a>00058         
<a name="l00059"></a>00059         set_pic_var(old_pic1, old_pic2);
<a name="l00060"></a>00060 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="gab5992248e26867cf6bb3b08aa822b37e"></a><!-- doxytag: member="rtc.h::rtc_write_alarm" ref="gab5992248e26867cf6bb3b08aa822b37e" args="(RTC_TIME *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rtc_write_alarm </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d5/d86/struct_r_t_c___t_i_m_e.html">RTC_TIME</a> *&nbsp;</td>
          <td class="paramname"> <em>rt</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write alarm to RTC</p>
<p>Uses <a class="el" href="../../da/dd5/group___real_time_controller.html#ga28ed5315f068afb9339b74dd434c04bd">write_rtcv()</a> and <a class="el" href="../../da/dd5/group___real_time_controller.html#ga4b857d1c0d66ceaf587d2343881252c1">dec2bcd()</a> </p>

<p>Definido na linha <a class="el" href="../../#L150">150</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00151"></a>00151 {
<a name="l00152"></a>00152         <a class="code" href="../../da/dd5/group___real_time_controller.html#ga28ed5315f068afb9339b74dd434c04bd">write_rtcv</a>(HOUR_ALARM, <a class="code" href="../../da/dd5/group___real_time_controller.html#ga4b857d1c0d66ceaf587d2343881252c1">dec2bcd</a>(rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#aeb283a5d8814993038c435081e7f0934" title="The hour of the day.">hour</a>));
<a name="l00153"></a>00153         <a class="code" href="../../da/dd5/group___real_time_controller.html#ga28ed5315f068afb9339b74dd434c04bd">write_rtcv</a>(MIN_ALARM, <a class="code" href="../../da/dd5/group___real_time_controller.html#ga4b857d1c0d66ceaf587d2343881252c1">dec2bcd</a>(rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a4b44a71ebc76adae29903e31e654ebc1" title="The minute of the day.">min</a>));
<a name="l00154"></a>00154         <a class="code" href="../../da/dd5/group___real_time_controller.html#ga28ed5315f068afb9339b74dd434c04bd">write_rtcv</a>(SEC_ALARM, <a class="code" href="../../da/dd5/group___real_time_controller.html#ga4b857d1c0d66ceaf587d2343881252c1">dec2bcd</a>(rt-&gt;<a class="code" href="../../d5/d86/struct_r_t_c___t_i_m_e.html#a9f4184ece6c72bbef577e4f4f84a18dc" title="The second of the day.">sec</a>));
<a name="l00155"></a>00155 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga18c4e040accb4c214682d5605f596e60"></a><!-- doxytag: member="rtc.h::write_rtc" ref="ga18c4e040accb4c214682d5605f596e60" args="(Byte add, Byte value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void write_rtc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>add</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write value to I/O address add. Doesn't check valid bit </p>

<p>Definido na linha <a class="el" href="../../#L89">89</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00090"></a>00090 {
<a name="l00091"></a>00091         <span class="keywordtype">int</span> old_pic1 = get_pic1(), old_pic2 = get_pic2();
<a name="l00092"></a>00092         set_pic_var(0xFF, 0xFF);
<a name="l00093"></a>00093 
<a name="l00094"></a>00094         outportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga710b98232df2c563009e6f8a6cd18220" title="I/O address that contains the RTC address to communicate with.">RTC_ADDR_REG</a>, add);
<a name="l00095"></a>00095         outportb(<a class="code" href="../../da/dd5/group___real_time_controller.html#ga2f258a00c59c3f347c8d2d4a75471ce0" title="I/O address that contains the data read from or written to the RTC.">RTC_DATA_REG</a>, value);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097         set_pic_var(old_pic1, old_pic2);
<a name="l00098"></a>00098 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga28ed5315f068afb9339b74dd434c04bd"></a><!-- doxytag: member="rtc.h::write_rtcv" ref="ga28ed5315f068afb9339b74dd434c04bd" args="(Byte add, Byte value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void write_rtcv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>add</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/d7f/group___user_types.html#gae3a497195d617519e5353ea7b417940f">Byte</a>&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write value to I/O address add. Check valid bit </p>

<p>Definido na linha <a class="el" href="../../#L103">103</a> do ficheiro <a class="el" href="../../">rtc.c</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00104"></a>00104 {
<a name="l00105"></a>00105         <a class="code" href="../../da/dd5/group___real_time_controller.html#gae9b349676544e84360bb9278ef4c0a96">rtc_valid</a>();
<a name="l00106"></a>00106         <a class="code" href="../../da/dd5/group___real_time_controller.html#ga18c4e040accb4c214682d5605f596e60">write_rtc</a>(add, value);
<a name="l00107"></a>00107 }
</pre></div></p>

</div>
</div>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Gerado em Tue Jun 1 22:05:39 2010 para FEUP-Defender por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
